package com.takeshi.landlords.resp;

/**
 * TakeshiException
 *
 * @author 725
 */
public class TakeshiException extends Exception {

    private static final long serialVersionUID = 1L;

    public TakeshiException() {
    }

    public TakeshiException(String message) {
        super(message);
    }

    /**
     * 把受检异常包装成非受检异常再抛出，避免破坏Java异常的结构，通过泛型的方式解决这个问题
     *
     * @param e
     * @param <E>
     * @throws E
     */
    @SuppressWarnings("unchecked")
    public static <E extends Exception> void lambdaThrowException(Exception e) throws E {
        throw (E) e;
    }

}
